function fadeLoadingPanel() {
    Ext.fly('loadingPanel').fadeOut();
}

Ext.application({
    requires: ['js.Util'],
    paths: {
        'Ext': 'ext'
    },
    appFolder: 'js',
    name: 'yz',
    success: function (response) {
        let obj = Ext.decode(response.responseText);
        let homePage = 'yz.Launcher';
        Ext.userData = {
            sysMenu: Ext.decode(obj.data.sys_menu_id || '[]'),
            sysbutton: obj.data.sys_button_id,
            group_id: obj.data.group_id,
            userName: obj.user_name || '',
            group_name: obj.data.group_name ? `${obj.data.group_name} - ` : '',
        };

        Ext.create(homePage, {
            listeners: {
                afterrender: fadeLoadingPanel
            }
        });
    },
    fail: function (response) {
        Ext.toast('服务器错误');
    },
    launch: function () {
        util.post('sysmenu').then(this.success, this.fail);
    }
});